(defun which-key/populate-buffer (prefix-keys formatted-keys
column-width sel-win-width)
"Insert FORMATTED-STRINGS into which-key buffer, breaking after BUFFER-WIDTH."
- (let* ((vertical-mode (member which-key-side-window-location '(left right)))
+ (let* ((vertical-mode (and (eq which-key-popup-type 'side-window)
+ (member which-key-side-window-location '(left right))))
+ (n-status-key 1)
+ (which-key-show-prefix nil)
(prefix-w-face (which-key/propertize-key prefix-keys))
(prefix-len (+ 2 (length (substring-no-properties prefix-w-face))))
(prefix-string (when which-key-show-prefix
(if (eq which-key-show-prefix 'left)
(concat prefix-w-face " ")
(concat prefix-w-face "-\n"))))
- (n-keys (length formatted-keys))
+ (n-keys (+ n-status-key (length formatted-keys)))
(max-dims (which-key/popup-max-dimensions sel-win-width))
(max-height (when (car max-dims) (car max-dims)))
(max-width-for-columns (if (cdr max-dims)
n-columns))
(act-width (+ (* n-columns column-width)
(if (eq which-key-show-prefix 'left) prefix-len 0)))
- ;; (avl-lines/page (which-key/available-lines))
(max-keys/page (when max-height (* n-columns max-height)))
(n-pages (if (> max-keys/page 0)
(ceiling (/ (float n-keys) max-keys/page)) 1))
+ (n-keys-pg1 (- (if (= 1 n-pages) n-keys max-keys/page) n-status-key))
+ (count (format "- [%s/%s]" n-keys-pg1 (- n-keys n-status-key)))
+ ;; (count-len (length count))
+ (status-key (concat prefix-keys count))
+ (status-key (s-pad-right column-width " " status-key))
+ (status-key (propertize status-key 'face 'font-lock-comment-face))
+ (fmtd-keys (if (= 1 n-status-key) (push status-key formatted-keys) formatted-keys))
pages act-height first-page)
+ (message "%s" status-key)
(if (and (> n-keys 0) (> n-columns 0))
(progn
(dotimes (p n-pages)